package org.example.service.impl;

import org.example.service.IArtisanService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

import java.util.concurrent.TimeUnit;

@Service
public class IArtisanServiceImpl implements IArtisanService {
    private final Logger logger = LoggerFactory.getLogger(this.getClass());

    @Async("asyncExecutor")
    @Override
    public void addArtisan() throws InterruptedException {
        TimeUnit.SECONDS.sleep(1);
        logger.info("线程名称:{} 执行方式: Async -- > addArtisan",Thread.currentThread().getName());
    }
}
